package cn.calm.j2se.jpa.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the bundle database table.
 * 
 */
@Embeddable
public class BundlePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="BUNDLE_SYMBOLIC_NAME", unique=true, nullable=false, length=200)
	private String bundleSymbolicName;

	@Column(name="BUNDLE_VERSION", unique=true, nullable=false, length=200)
	private String bundleVersion;

    public BundlePK() {
    }
	public String getBundleSymbolicName() {
		return this.bundleSymbolicName;
	}
	public void setBundleSymbolicName(String bundleSymbolicName) {
		this.bundleSymbolicName = bundleSymbolicName;
	}
	public String getBundleVersion() {
		return this.bundleVersion;
	}
	public void setBundleVersion(String bundleVersion) {
		this.bundleVersion = bundleVersion;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof BundlePK)) {
			return false;
		}
		BundlePK castOther = (BundlePK)other;
		return 
			this.bundleSymbolicName.equals(castOther.bundleSymbolicName)
			&& this.bundleVersion.equals(castOther.bundleVersion);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.bundleSymbolicName.hashCode();
		hash = hash * prime + this.bundleVersion.hashCode();
		
		return hash;
    }
}